<!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>Floyd Warshall Algorithm All Pair Shortest Path</title>
        <style>
</style>
        
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/markdown.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/highlight.css">
<style>
            body {
                font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif;
                font-size: 14px;
                line-height: 1.6;
            }
        </style>
        <style>
.task-list-item { list-style-type: none; } .task-list-item-checkbox { margin-left: -20px; vertical-align: middle; }
</style>
        
        
        
    </head>
    <body class="vscode-light">
        <h1 id="floyd-warshall-algorithm-all-pair-shortest-path">Floyd Warshall Algorithm All Pair Shortest Path</h1>
<p>Floyd Warshall算法特点</p>
<ul>
<li>求有向图，无向图中任意两点的最短距离</li>
<li>支持负数权重边</li>
<li>能坚持负数环</li>
</ul>
<p>Link</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=LwJdNfdLF9s&amp;list=PLrmLmBdmIlpu2f2g8ltqaaCZiq6GJvl1j&amp;index=9">https://www.youtube.com/watch?v=LwJdNfdLF9s&amp;list=PLrmLmBdmIlpu2f2g8ltqaaCZiq6GJvl1j&amp;index=9</a></li>
<li><a href="https://github.com/mission-peace/interview/blob/master/src/com/interview/graph/FloydWarshallAllPairShortestPath.java">https://github.com/mission-peace/interview/blob/master/src/com/interview/graph/FloydWarshallAllPairShortestPath.java</a></li>
</ul>
<p><img src="file:///e:\gitee\leetcode\graph\pics\floyd1.png" alt="floyd1.png"></p>
<p>时间复杂度， O(n^3), 感觉像是 bellman算法的增强版。也是反复对每条边松弛. floyd循环了n次， bellman循环了n-1次</p>

    </body>
    </html>